#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pygame
from pygame.locals import *

from data.variables import *

class clase:					# Animacion del principio
	def __init__(self, main):
		self.select = True
		
		self.fondo_orig = pygame.image.load('recursos/img/inicio/anonymouszombie.png').convert()
		self.fondo = pygame.transform.smoothscale(self.fondo_orig,(main["general"]["resolucion"][1]*16/9,main["general"]["resolucion"][1]))
		self.timer = 0
		self.fondo_alpha = 0
		
	def activar(self,main):
		pass
		
	def seleccionar(self,main):
		pass
	
	def click(self,main):
		pass
	
	def tecla(self,main):
		pass
	
	def proceso(self,main):
		if 0 < self.timer < 30:
			self.fondo_alpha = self.timer * 8.5
		elif 60 < self.timer < 120:
			self.fondo_alpha = (self.timer - 120) * (-4.25)
		elif 120 < self.timer:
			main["ventana"]["borrar"].append("inicio")
			main["ventana"]["crear"].append("login")
			main["ventana"]["seleccionar"].append("login")
		self.fondo.set_alpha(self.fondo_alpha)
		self.timer = self.timer + 1
	
	def graficar(self,main):
		main["general"]["pantalla"].blit(self.fondo,(0,0))
		
